@page
@inherits Payment.Web.Pages.PaymentPageBase
@using EventHub.Options
@using EventHub.Web
@using Microsoft.Extensions.Options
@using Payment.PaymentRequests
@using Volo.Abp.Users
@model EventHub.Web.Pages.Payment.CustomPostCheckoutPageModel
@inject IOptions<EventHubUrlOptions> UrlOptions
@inject ICurrentUser CurrentUser

@{
    PageLayout.Content.Title = L["PaymentResult"] + L["Enum:PaymentRequestState:" + Model.PaymentRequest.State];
}

<main class="static-page container mt-5 text-center">
    <div class="page-title">
          @if (Model.PaymentRequest.State == PaymentRequestState.Completed)
          {
              <h1 class="text-commercial">
                  <i class="fa fa-check-circle fa-2x mb-4 text-success"></i>
                  <br/>Payment Successful
              </h1>

              <h3>Thank you for your purchase!</h3>
          }
          else if(Model.PaymentRequest.State == PaymentRequestState.Failed)
          {
              <h1 class="text-commercial">
                  <i class="fa fa-times fa-2x mb-4 text-danger"></i>
                  <br/>Payment failed
                  
                  <abp-alert alert-type="Danger" class="mt-4">
                      A notification e-mail will be sent to you about why the payment process failed.
                  </abp-alert>
              </h1>

              <abp-button class="mt-4" href="@Model.GoBackLink" button-type="Dark" text="@L["GoBack"]"/>
          }
          else
          {
              <h1 class="text-commercial">
                  <i class="fa fa-clock fa-2x mb-4 text-primary"></i>
                  <br/>An e-mail will be sent to you when your payment is completed.
              </h1>

              <abp-alert alert-type="Info" class="mt-4">
                  If you do not receive an e-mail within 1 hour, please contact <a href="mailto:info@volosoft.com">info@volosoft.com</a>
              </abp-alert>
          }
          
          <div class="row">
              <div class="col-md-8 mx-auto text-center">
                  <hr class="mt-4 mb-5" />
                  <a href="/" class="btn btn-sm btn-outline-primary">Home page</a>
                  <a href="@UrlOptions.Value.Www/organizations/@Model.OrganizationName" class="btn btn-sm btn-primary">My Organization</a>
              </div>
          </div>
    </div>
</main>
